<template>
  <div class="app-container">
          <div>
        <el-table v-loading="listLoading" :data="list"  style="width: 100%"  >

      
         <el-table-column width="260px" align="center" label="内容">
        <template slot-scope="scope">
          <span>{{ scope.row.content }}</span>
        </template>
         </el-table-column>

           <el-table-column width="150px" align="center" label="手机号码">
        <template slot-scope="scope">
          <span>{{ scope.row.phone }}</span>
        </template>
         </el-table-column>

           <el-table-column width="120px" align="center" label="反馈者">
        <template slot-scope="scope">
          <span>{{ scope.row.name }}</span>
        </template>
         </el-table-column>
      
       <el-table-column width="180px" align="center" label="时间">
        <template slot-scope="scope">
          <span>{{ resolvingDate(scope.row.createTime)}}</span>
        </template>
      </el-table-column>
    </el-table>
        
     </div>
  <pagination style="margin-top: 8px;" v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.size" @pagination="fetchData" />
        
  </div>
</template>

<script>
import { mapGetters } from "vuex"
import { getFeedList} from '@/api/user'
import ImagePath from '../../../static/logo.png'
import Pagination from '@/components/Pagination'
import { resolvingDate } from '@/utils/index'

export default {
   name: 'Center',
  components: { Pagination },
   computed: {
    ...mapGetters(["token"]),
    ...mapGetters(["user_id"])
  },
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: 'success',
        draft: 'gray',
        deleted: 'danger'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      list: null,
      dialogFormVisible: false,
      listLoading: true,
      imgUrl: ImagePath,
       listQuery: {
        page: 1,
        size: 10,
        
      },
      user: null,
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
       
        this.listLoading = true
        getFeedList(this.listQuery).then(response => {
        this.list = response.data.data
        this.total = response.data.totalElements
        this.listLoading = false
      })
    },
      //时间格式化
    resolvingDate,
  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
.el-table th {
    /*  */
    background-color: #fff !important;
}
 .avatar-uploader-icon {
    font-size: 28px;
    width: 120px;
    height: 120px;
    line-height: 120px;
    text-align: center
  }
  .avatar {
    width: 120px;
    height: 120px;
    // display: block;
    border-radius: 50%;
    margin-bottom: 10px;
    text-align: center
  }
  .user-info {
    padding-left: 0px;
    list-style: none;
    li{
      border-bottom: 1px solid #F0F3F4;
      border-top: 1px solid #F0F3F4;
      padding: 11px 0px;
      font-size: 13px;
    }
    .user-right {
      float: right;

      a{
        color: #317EF3;
      }
    }
  }
</style>

